menuitem: Always treat submenus as popup
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 25 Oct 2011 13:42:59 +0000 (15:42 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 5 Nov 2011 05:49:50 +0000 (01:49 -0400)
Submenus are not actually attached to a menubar, but styling them
as if they were imposes some problems (at least with Adwaita).
Just using GDK_WINDOW_TYPE_HINT_POPUP_MENU for submenus instead
fixes the issue.

https://bugzilla.gnome.org/show_bug.cgi?id=662691

gtk/gtkmenuitem.c

index 95a862b9c50a76c8118df9eb1e7cf1b2926754ba..56c97e55e3fc20184aeb6ba6e6c602dd0de4bd20 100644 (file)
@@ -2168,21 +2168,7 @@ gtk_menu_item_position_menu (GtkMenu  *menu,
   available_right = monitor.x + monitor.width - (tx + allocation.width);
 
   parent = gtk_widget_get_parent (widget);
-  if (GTK_IS_MENU_BAR (parent))
-    {
-      priv->from_menubar = TRUE;
-    }
-  else if (GTK_IS_MENU (parent))
-    {
-      if (GTK_MENU (parent)->priv->parent_menu_item)
-        priv->from_menubar = GTK_MENU_ITEM (GTK_MENU (parent)->priv->parent_menu_item)->priv->from_menubar;
-      else
-        priv->from_menubar = FALSE;
-    }
-  else
-    {
-      priv->from_menubar = FALSE;
-    }
+  priv->from_menubar = GTK_IS_MENU_BAR (parent);
 
   switch (priv->submenu_placement)
     {